#include <utils/address.h>


namespace AccountManagerUtils {
	
//! Default constructor
Address::Address() : street_name_(""), unit_name_(""), city_name_(""), zip_code_(""), state_(""), country_("") {}

//! Copy constructor
Address::Address(const Address& rhs) : street_name_(rhs.street_name_), unit_name_(rhs.unit_name_),
	city_name_(rhs.city_name_), zip_code_(rhs.zip_code_), state_(rhs.state_), country_(rhs.country_) {}

//! Constructor from a street and a city
Address::Address(const String& street, const String& city) :
	street_name_(street), unit_name_(""), city_name_(city), zip_code_(""), state_(""), country_("") {}
	
//! Constructor from a street, a city and a zip code
Address::Address(const String& street, const String& city, const String& zip_code) :
	street_name_(street), unit_name_(""), city_name_(city), zip_code_(zip_code), state_(""), country_("") {}
	
//! Constructor from a street, a city, a zip code and a country
Address::Address(const String& street, const String& city, const String& zip_code, const String& country) :
	street_name_(street), unit_name_(""), city_name_(city), zip_code_(zip_code), state_(""), country_(country) {}
	
//! Constructor from a street, a city, a zip code, a state and a country
Address::Address(const String& street, const String& city, const String& zip_code, const String& state, const String& country) :
	street_name_(street), unit_name_(""), city_name_(city), zip_code_(zip_code), state_(state), country_(country) {}

//! Destructor
Address::~Address() {}

//! Assignment operator
Address& Address::operator=(const Address& rhs) {
	if ( &rhs != this ) {
		street_name_ = rhs.street_name_;
		unit_name_ = rhs.unit_name_;
		city_name_ = rhs.city_name_;
		zip_code_ = rhs.zip_code_;
		state_ = rhs.state_;
		country_ = rhs.country_;
	}
	return *this;
}
	
//! Accessor to the name of the street (read-write)
String& Address::street_name() {
	return street_name_;
}

//! Accessor to the name of the street (read only)
const String& Address::street_name() const {
	return street_name_;
}

//! Accessor to the name of the unit (read-write)
String& Address::unit_name() {
	return unit_name_;
}

//! Accessor to the name of the unit (read only)
const String& Address::unit_name() const {
	return unit_name_;
}

//! Accessor to the name of the city (read-write)
String& Address::city_name() {
	return city_name_;
}

//! Accessor to the name of the city (read only)
const String& Address::city_name() const {
	return city_name_;
}

//! Accessor to the zip code of the city (read-write)
String& Address::zip_code() {
	return zip_code_;
}

//! Accessor to the zip code of the city (read only)
const String& Address::zip_code() const {
	return zip_code_;
}

//! Accessor to the name of the state (read-write)
String& Address::state() {
	return state_;
}

//! Accessor to the name of the state (read only)
const String& Address::state() const {
	return state_;
}

//! Accessor to the name of the country (read-write)
String& Address::country() {
	return country_;
}

//! Accessor to the name of the country (read only)
const String& Address::country() const {
	return country_;
}

} // namespace AccountManagerUtils

